package com.ndood.payment.core.exception;

import com.ndood.payment.core.constaints.PCode;

public class PException extends Exception {
	private static final long serialVersionUID = 13168926815908268L;

	private PCode code;
	
	private String message;

	public PCode getCode() {
		return code;
	}

	public void setCode(PCode code) {
		this.code = code;
	}

	public PException(String message) {
		super(message);
	}

	public PException(PCode code) {
        super(code.getValue());
        this.code = code;
    }
	
	public PException(PCode code, String message) {
		super(message);
        this.code = code;
        this.message = message;
    }

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

}